package com.linewell.license.demo.designPattern.createPattern.FactotyPattern;

import com.linewell.license.demo.designPattern.createPattern.FactotyPattern.car.CarFactory;
import com.linewell.license.demo.designPattern.createPattern.FactotyPattern.cycle.CycleFactory;

/**
 * @Title: springBootDemo
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2019/11/22
 */
public class FactoryProducer {
    public static AbstractFactory getFactory(String choice){
        if(choice.equalsIgnoreCase("cycle")){
            return new CycleFactory();
        } else if(choice.equalsIgnoreCase("car")){
            return new CarFactory();
        }
        return null;
    }
}
